package com.example.exam18;

import android.graphics.Bitmap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.HashMap;

class MyAdapter extends BaseAdapter {
    ArrayList list;
    MainActivity activity;
    public MyAdapter(ArrayList list,MainActivity activity){
        this.list=list;
        this.activity=activity;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View inflate = View.inflate(activity, R.layout.layout2, null);
        TextView t1 = inflate.findViewById(R.id.t1);
        TextView t2 = inflate.findViewById(R.id.t2);
        TextView t3 = inflate.findViewById(R.id.t3);
        HashMap<Object, Object> map = new HashMap<>();
        t1.setText(map.get("author").toString());
        t2.setText(map.get("link").toString());
        t3.setText(map.get("superChapterName").toString());
        return inflate;
    }
}
